package com.fengke.dao.product;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.fengke.dao.model.AdminStoryModel;
import com.fengke.dao.model.DepartureModel;
import com.fengke.dao.model.DestinationModel;
import com.fengke.dao.model.PriceItemModel;
import com.fengke.dao.model.ProductImageModel;
import com.fengke.dao.model.ProductItemModel;
import com.fengke.dao.model.ProductModel;
import com.fengke.dao.model.ProductCategoryModel;
import com.fengke.dao.model.ProductTagModel;

public interface ProductManager {
	/**
	 * 
	 * @param productModel
	 * @param offset -- skip
	 * @param limit -- pageSize
	 * @return
	 * @throws SQLException
	 */
	List<ProductModel> researchProductList(ProductModel productModel, int offset, int limit) throws SQLException;
	/**
	 * 获取结果集大小
	 * @param productModel
	 * @return
	 * @throws SQLException
	 */
	Integer researchProductListSize(ProductModel productModel) throws SQLException;
	/**
	 * 批量删除
	 * 
	 * @param idList
	 *          list = idList
	 * @return
	 *        更新条数
	 * @throws SQLException
	 */
	int deleteProductByIds(List<String> idList) throws SQLException;
	/**
	 * 更新
	 * 
	 * @param productModel
	 * @return
	 *        更新条数
	 * @throws SQLException
	 */
	int updateProductById(ProductModel productModel) throws SQLException;
	/**
	 * 插入数据
	 * 
	 * @param productModel
	 * @return 新增条目的ID
	 * @throws SQLException
	 */
	Object createProduct(ProductModel productModel) throws SQLException;
	/**
	 * 根据ID检索商品
	 * 
	 * @param productModel
	 * @return
	 * @throws SQLException
	 */
	ProductModel researchProductById(ProductModel productModel) throws SQLException;
	/**
	 * 检索商品类型列表
	 * 
	 * @param productCategory
	 * @param offset
	 * @param limit
	 * @return
	 */
	List<ProductCategoryModel> researchProductCategoryList(ProductCategoryModel productCategory, int offset, int limit) throws SQLException;
	/**
	 * 插入行程
	 * 
	 * @param productItemModel
	 * @return
	 * @throws SQLException
	 */
	Object createProductItem(ProductItemModel productItemModel) throws SQLException;
	/**
	 * 插入商家故事
	 * @param adminStoryModel
	 * @return
	 * @throws SQLException
	 */
	Object createAdminStory(AdminStoryModel adminStoryModel) throws SQLException;
	/**
	 * 根据商品ID列表删除行程
	 * @param productIdList
	 * @return
	 * @throws SQLException
	 */
	int deleteProductItemByProductIds(List<String> productIdList) throws SQLException;
	/**
	 * 根据商品ID列表删除卖家故事
	 * @param productIdList
	 * @return
	 * @throws SQLException
	 */
	int deleteAdminStoryByProductIds(List<String> productIdList) throws SQLException;
	/**
	 * 检索行程列表
	 * 
	 * @param productItemModel
	 * @return
	 * @throws SQLException
	 */
	List<ProductItemModel> researchProductItemList(ProductItemModel productItemModel) throws SQLException;
	/**
	 * 检索商家故事列表
	 * @param adminStoryModel
	 * @return
	 * @throws SQLException
	 */
	List<AdminStoryModel> researchAdminStoryList(AdminStoryModel adminStoryModel) throws SQLException;
	/**
	 * 更新行程
	 * @param itemModel
	 * @return
	 * @throws SQLException
	 */
	int updateProductItemById(ProductItemModel itemModel) throws SQLException;
	/**
	 * 更新商家故事
	 * @param story
	 * @return
	 * @throws SQLException
	 */
	int updateAdminStoryById(AdminStoryModel story) throws SQLException;
	/**
	 * 根据商品ID列表删除商品轮播图片
	 * 
	 * @param productIdList
	 * @return
	 * @throws SQLException
	 */
	int deleteProductImageByProductIds(List<String> productIdList) throws SQLException;
	/**
	 * 检索商品轮播图片
	 * @param productImageModel
	 * @return
	 * @throws SQLException
	 */
	List<ProductImageModel> researchProductImageList(ProductImageModel productImageModel) throws SQLException;
	/**
	 * 新增商品轮播图片
	 * @param productImageModel
	 * @throws SQLException
	 */
	void createProductImage(ProductImageModel productImageModel) throws SQLException;
	Long createProductCategory(ProductCategoryModel productCategoryModel) throws SQLException;
	int updateProductCategoryById(ProductCategoryModel productCategoryModel) throws SQLException;
	int deleteProductCategoryByIds(List<String> list) throws SQLException;
	int marketableProductByIds(Map<String, Object> paramMap) throws SQLException;
	List<ProductCategoryModel> researchProductCategoryListByOnlineProduct(ProductModel productModel) throws SQLException;
	List<DepartureModel> researchDepartureListByOnlineProduct(ProductModel productModel) throws SQLException;
	List<DestinationModel> researchDestinationListByOnlineProduct(ProductModel productModel) throws SQLException;
	List<String> researchStartDateListByOnlineProduct(ProductModel productModel) throws SQLException;
	Long createPriceItem(PriceItemModel priceItemModel) throws SQLException;
	List<PriceItemModel> researchPriceItemList(PriceItemModel priceItemModel) throws SQLException;
	int deletePriceItemByProductIds(List<String> list) throws SQLException;
	void createProductTag(ProductTagModel productTagModel) throws SQLException;
	List<ProductTagModel> researchProductTagListByProductId(ProductTagModel productTagModel) throws SQLException;
	int deleteProductTagByProductIds(List<String> list) throws SQLException;
}
